<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<!--引入head的公共部分-->
<head th:replace="header::header-commo(我的订单)"></head>
<body>
<!--引入header的公共部分-->
<header th:replace="header::header-nav"></header>
<div class="container" style="margin-top: 20px;">
    <div class="list-group" th:each="order:${orders}">
        <p>订单号: <span th:text="${order.oid}"></span></p>
        <div class="list-group-item">
            <table class="table table-condensed">
                <thead>
                <tr>
                    <th>图片</th>
                    <th>商品</th>
                    <th>单价(元)</th>
                    <th>数量</th>
                    <th>小计</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="orderItem:${order.orderItems}">
                    <td><img th:src="@{'/upload/'+${orderItem.item.image}}" src="images/1big.jpg" class="buyimg"/></td>
                    <td th:text="${orderItem.item.name}">提莫 手办</td>
                    <td th:text="'¥'+${orderItem.item.shopPrice}">¥150.00</td>
                    <td th:text="${orderItem.count}">1</td>
                    <td th:text="'¥'+${orderItem.subtotal}">¥150.00</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="list-group-item" style="margin-bottom: 10px;">
            收货人姓名：<strong><span th:text="${order.name}"></span></strong><br>
            收货人联系方式：<strong><span th:text="${order.telephone}"></span></strong><br>
            收货人地址：<strong><span th:text="${order.address}"></span></strong><br>
        </div>
        <div class="text-right list-group-item" style="margin-bottom: 10px;">
            商品金额：<span class="xiangq_font3" th:text="'¥'+${order.total}+'元'">¥150.00元</span>
            <h4 th:if="${order.state}==0"><span style="color: green" class="glyphicon glyphicon-ok-circle"></span> 已付款</h4>
            <h4 th:if="${order.state}==1"><span style="color: red" class="glyphicon glyphicon-remove-circle"></span> 未付款</h4>
            <div th:if="${order.state}==1">
                <form method="post" th:action="@{/pay/order}">
                    <input type="hidden" name="WIDout_trade_no" th:value="${order.oid}">
                    <input type="hidden" name="WIDtotal_amount" th:value="${order.total}">
                    <input type="hidden" name="name" th:value="${order.name}">
                    <input type="hidden" name="address" th:value="${order.address}">
                    <input type="hidden" name="telephone" th:value="${order.telephone}">
                    <input type="submit" class="btn btn-success" value="支付宝支付">
                </form>
            </div>
        </div>
    </div>
</div>
<!--底部-->
<footer th:replace="footer::footer"></footer>
</body>
</html>